// 路由
const express = require('express')
const router = express.Router()

// 首页(请求的数据都在商品管理)
const index = require('./admin/index')
router.get('/index/qqq',index.quan)

// 用户管理
const user = require('./admin/user')
router.get('/user/list',user.list)
router.delete('/user/delete/:id',user.deleteUser)
router.post('/user/add',user.addUser)
router.put('/user/update/:id',user.updateUser)

// 商品管理
const goods = require('./admin/goods')
router.get('/goods/list',goods.list)
router.delete('/goods/delete/:id',goods.deleteGoods)
router.post('/goods/add',goods.addGoods)
router.put('/goods/update/:id',goods.updateGoods)
router.get('/goods/allGoodsAddress',goods.getAllGoodsAddress)
router.get('/goods/allGoodsTypeNum',goods.getAllGoodsTypeNum)
router.get('/goods/allGoodsAddressNum',goods.getAllGoodsAddressNum)

// 订单管理
const order = require('./admin/order')
router.get('/order/list',order.list)
router.delete('/order/delete/:id',order.deleteOrder)
router.post('/order/add',order.addOrder)
router.put('/order/update/:id',order.updateOrder)
// 这个算是前台购物的接口
router.post('/order/buyGoods',order.buyGoods)

// 设置
const set = require('./admin/set')
router.get('/setSlideImg/list',set.listSlideImg)
router.delete('/setSlideImg/delete/:id',set.deleteSlideImg)
router.post('/setSlideImg/add',set.addSlideImg)

// 导出路由
module.exports=router
